<?php

namespace app\admin\model;

use think\Model;

class Relation extends Model
{
    use TraitModel;

    public function getUidAttr($value)
    {
        $res = model('admin/user')->where('id', $value)->value('image');

        return $res;
    }

    public function getTypeAttr($value)
    {
        $status = [-1 => '断开关系', 0 => '来自分享', 1 => '来自扫码', 2 => '系统默认'];
        $data = [
            'id' => $value,
            'text' => $status[$value],
        ];

        return $data;
    }
}
